#ifndef H_COMS
#define H_COMS

/* Modem commands */
#define SLEEP 0x80
#define WAKE  0xFF
#define ENQ0  0x40
#define TXSTT 0xBF /* May need to be changed for different timing */
#define TXEND 0x20

/* Modem received characters */
#define RQD   0x01
#define WAKAK 0x02
#define ACK   0x00

#define MODEM_TIMEOUT 100000 /* About 12ms or longer */

/* External functions */
void comsInit(void);
int comsSend(unsigned char mod_in, int sendtype, int replytype, unsigned char replychar);
int modInit();
int modENQ0();
int modTransmit(unsigned char sendchar);

/* Interrupts */
interrupt(USART1RX_VECTOR) receivetrigger();
interrupt(USART1TX_VECTOR) transmittrigger();

#endif /* H_COMS */
